package com.stormrage.entity.adm.rep;

import java.io.Serializable;

import com.stormrage.entity.adm.AdmAcct;

public class AdmAcctRep implements Serializable {

	// ------------------------------- Fields -------------------------------

	private static final long serialVersionUID = 647099461038289604L;

	// ------------------------------- Fields -------------------------------

	private Integer seq;

	private Integer id;

	private String acct;

	private String name;

	private Integer role;

	private Integer locked;

	private String lockedStr;

	private String count;

	// ------------------------------- Fields -------------------------------

	public AdmAcctRep() {
	}

	// ------------------------------- Fields -------------------------------

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getAcct() {
		return acct;
	}

	public void setAcct(String acct) {
		this.acct = acct;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getRole() {
		return role;
	}

	public void setRole(Integer role) {
		this.role = role;
	}

	public Integer getLocked() {
		return locked;
	}

	public void setLocked(Integer locked) {
		this.locked = locked;
	}

	public String getLockedStr() {
		return lockedStr;
	}

	public void setLockedStr(String lockedStr) {
		this.lockedStr = lockedStr;
	}

	public String getCount() {
		return count;
	}

	public void setCount(String count) {
		this.count = count;
	}

	// ------------------------------- Fields -------------------------------

	public static AdmAcctRep instance(AdmAcct arg0, Integer seq, Integer count) {
		AdmAcctRep entity = new AdmAcctRep();
		entity.setSeq(seq);
		entity.setId(arg0.getId());
		entity.setAcct(arg0.getAcct());
		entity.setName(arg0.getRealName());
		entity.setRole(arg0.getRole());
		entity.setLocked(arg0.getLocked());
		if (arg0.getLocked().equals(0))
			entity.setLockedStr("未锁定");
		if (arg0.getLocked().equals(1))
			entity.setLockedStr("锁定");
		if (arg0.getRole().equals(0))
			entity.setCount("所有权限");
		if (arg0.getRole().equals(1))
			entity.setCount(String.valueOf(count));
		return entity;
	}

	@Override
	public String toString() {
		return this.getClass() + " : id - " + id + " acct - " + acct + " name - " + name + " count - " + count;
	}

}
